home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / nslock15 / cripplew.frm next >
Text File  |  1999-03-16  |  5KB  |  169 lines

  1. VERSION 5.00
  2. Object = "{ADD24EDC-ADC1-11D2-95D1-F7A835DD4948}#3.0#0"; "nslock15vb5.ocx"
  3. Begin VB.Form Form1 
  4.    Caption         =   "ActiveLock sample"
  5.    ClientHeight    =   2790
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   5190
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   2790
  11.    ScaleWidth      =   5190
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin nslock15vb5.ActiveLock ActiveLock1 
  14.       Left            =   3720
  15.       Top             =   1200
  16.       _ExtentX        =   847
  17.       _ExtentY        =   820
  18.       Password        =   "PA$$WORD..."
  19.       SoftwareName    =   "Crippleware Sample"
  20.       LiberationKeyLength=   16
  21.       SoftwareCodeLength=   16
  22.    End
  23.    Begin VB.CommandButton Command2 
  24.       Caption         =   "Command2"
  25.       Height          =   375
  26.       Left            =   3720
  27.       TabIndex        =   10
  28.       Top             =   720
  29.       Width           =   1215
  30.    End
  31.    Begin VB.CommandButton Command1 
  32.       Caption         =   "Command1"
  33.       Height          =   375
  34.       Left            =   3720
  35.       TabIndex        =   9
  36.       Top             =   240
  37.       Width           =   1215
  38.    End
  39.    Begin VB.CommandButton cmdUnRegister 
  40.       Caption         =   "Unregister"
  41.       Height          =   375
  42.       Left            =   3720
  43.       TabIndex        =   7
  44.       Top             =   1800
  45.       Width           =   1215
  46.    End
  47.    Begin VB.Frame frameRegister 
  48.       Caption         =   "Please, register !"
  49.       Height          =   2055
  50.       Left            =   120
  51.       TabIndex        =   0
  52.       Top             =   120
  53.       Width           =   3375
  54.       Begin VB.CommandButton cmdRegister 
  55.          Caption         =   "Register !"
  56.          Height          =   375
  57.          Left            =   2040
  58.          TabIndex        =   6
  59.          Top             =   1440
  60.          Width           =   1095
  61.       End
  62.       Begin VB.TextBox Text2 
  63.          Height          =   285
  64.          Left            =   1440
  65.          TabIndex        =   5
  66.          Text            =   "Text2"
  67.          Top             =   960
  68.          Width           =   1695
  69.       End
  70.       Begin VB.TextBox Text1 
  71.          BackColor       =   &H8000000F&
  72.          Height          =   285
  73.          Left            =   1440
  74.          Locked          =   -1  'True
  75.          TabIndex        =   3
  76.          Text            =   "Text1"
  77.          Top             =   600
  78.          Width           =   1695
  79.       End
  80.       Begin VB.Label Label3 
  81.          Caption         =   "Liberation key:"
  82.          Height          =   255
  83.          Left            =   120
  84.          TabIndex        =   4
  85.          Top             =   960
  86.          Width           =   1335
  87.       End
  88.       Begin VB.Label Label2 
  89.          Caption         =   "Software code:"
  90.          Height          =   255
  91.          Left            =   120
  92.          TabIndex        =   2
  93.          Top             =   600
  94.          Width           =   1335
  95.       End
  96.       Begin VB.Label Label1 
  97.          Caption         =   "You've been using this software for 0 days."
  98.          Height          =   255
  99.          Left            =   120
  100.          TabIndex        =   1
  101.          Top             =   240
  102.          Width           =   3135
  103.       End
  104.    End
  105.    Begin VB.Label Label4 
  106.       Caption         =   $"crippleware.frx":0000
  107.       Height          =   495
  108.       Left            =   120
  109.       TabIndex        =   8
  110.       Top             =   2280
  111.       Width           =   4815
  112.    End
  113. End
  114. Attribute VB_Name = "Form1"
  115. Attribute VB_GlobalNameSpace = False
  116. Attribute VB_Creatable = False
  117. Attribute VB_PredeclaredId = True
  118. Attribute VB_Exposed = False
  119. Option Explicit
  120.  
  121. Private Sub cmdRegister_Click()
  122.   ActiveLock1.LiberationKey = Text2
  123.   If ActiveLock1.RegisteredUser Then
  124.     frameRegister.Visible = False
  125.     MsgBox "Thanks for registering!"
  126.     Command1.Enabled = True
  127.     Command2.Enabled = True
  128.     cmdUnRegister.Enabled = True
  129.   Else
  130.     MsgBox "Wrong key, try again!"
  131.     Text2.SelStart = 0
  132.     Text2.SelLength = Len(Text2)
  133.     Text2.SetFocus
  134.   End If
  135. End Sub
  136.  
  137. Private Sub cmdUnRegister_Click()
  138.   Dim R As VbMsgBoxResult
  139.   R = MsgBox("Are you sure that you want to unregister this software?", vbYesNo)
  140.   If R = vbYes Then
  141.     ActiveLock1.LiberationKey = "0"
  142.     Unload Me
  143.   End If
  144. End Sub
  145.  
  146. Private Sub Command1_Click()
  147.   MsgBox "Command1 code goes here."
  148. End Sub
  149.  
  150. Private Sub Command2_Click()
  151.   MsgBox "Command2 code goes here."
  152. End Sub
  153.  
  154. Private Sub Form_Load()
  155.   ' If the user hasn't registered yet,
  156.   ' shows the registration frame
  157.   If ActiveLock1.RegisteredUser Then
  158.     frameRegister.Visible = False
  159.   Else
  160.     Text1 = ActiveLock1.SoftwareCode
  161.     Text2 = ""
  162.     Label1 = "You've been using this software for " _
  163.           & ActiveLock1.UsedDays & " day(s)."
  164.     Command1.Enabled = False
  165.     Command2.Enabled = False
  166.     cmdUnRegister.Enabled = False
  167.   End If
  168. End Sub
  169.